Optimal. Leaf size=29 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b-b \tanh ^2(x)}}\right )}{\sqrt {a}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4213, 385, 212}
\begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a-b \tanh ^2(x)+b}}\right )}{\sqrt {a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 385
Rule 4213
Rubi steps
\begin {align*} \int \frac {1}{\sqrt {a+b \text {sech}^2(x)}} \, dx &=\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \sqrt {a+b-b x^2}} \, dx,x,\tanh (x)\right )\\ &=\text {Subst}\left (\int \frac {1}{1-a x^2} \, dx,x,\frac {\tanh (x)}{\sqrt {a+b-b \tanh ^2(x)}}\right )\\ &=\frac {\tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b-b \tanh ^2(x)}}\right )}{\sqrt {a}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(62\) vs. \(2(29)=58\).
time = 0.03, size = 62, normalized size = 2.14 \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \sinh (x)}{\sqrt {a+b+a \sinh ^2(x)}}\right ) \sqrt {a+2 b+a \cosh (2 x)} \text {sech}(x)}{\sqrt {2} \sqrt {a} \sqrt {a+b \text {sech}^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 1.69, size = 0, normalized size = 0.00 \[\int \frac {1}{\sqrt {a +b \mathrm {sech}\left (x \right )^{2}}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 250 vs.
\(2 (23) = 46\).
time = 0.40, size = 1059, normalized size = 36.52 \begin {gather*} \left [\frac {\sqrt {a} \log \left (\frac {a b^{2} \cosh \left (x\right )^{8} + 8 \, a b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{7} + a b^{2} \sinh \left (x\right )^{8} - 2 \, {\left (a b^{2} - b^{3}\right )} \cosh \left (x\right )^{6} + 2 \, {\left (14 \, a b^{2} \cosh \left (x\right )^{2} - a b^{2} + b^{3}\right )} \sinh \left (x\right )^{6} + 4 \, {\left (14 \, a b^{2} \cosh \left (x\right )^{3} - 3 \, {\left (a b^{2} - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{5} + {\left (a^{3} + 4 \, a^{2} b + 9 \, a b^{2}\right )} \cosh \left (x\right )^{4} + {\left (70 \, a b^{2} \cosh \left (x\right )^{4} + a^{3} + 4 \, a^{2} b + 9 \, a b^{2} - 30 \, {\left (a b^{2} - b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{4} + 4 \, {\left (14 \, a b^{2} \cosh \left (x\right )^{5} - 10 \, {\left (a b^{2} - b^{3}\right )} \cosh \left (x\right )^{3} + {\left (a^{3} + 4 \, a^{2} b + 9 \, a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + a^{3} + 2 \, {\left (a^{3} + 3 \, a^{2} b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (14 \, a b^{2} \cosh \left (x\right )^{6} - 15 \, {\left (a b^{2} - b^{3}\right )} \cosh \left (x\right )^{4} + a^{3} + 3 \, a^{2} b + 3 \, {\left (a^{3} + 4 \, a^{2} b + 9 \, a b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + \sqrt {2} {\left (b^{2} \cosh \left (x\right )^{6} + 6 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{5} + b^{2} \sinh \left (x\right )^{6} - 3 \, b^{2} \cosh \left (x\right )^{4} + 3 \, {\left (5 \, b^{2} \cosh \left (x\right )^{2} - b^{2}\right )} \sinh \left (x\right )^{4} + 4 \, {\left (5 \, b^{2} \cosh \left (x\right )^{3} - 3 \, b^{2} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - {\left (a^{2} + 4 \, a b\right )} \cosh \left (x\right )^{2} + {\left (15 \, b^{2} \cosh \left (x\right )^{4} - 18 \, b^{2} \cosh \left (x\right )^{2} - a^{2} - 4 \, a b\right )} \sinh \left (x\right )^{2} - a^{2} + 2 \, {\left (3 \, b^{2} \cosh \left (x\right )^{5} - 6 \, b^{2} \cosh \left (x\right )^{3} - {\left (a^{2} + 4 \, a b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \sqrt {a} \sqrt {\frac {a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + a + 2 \, b}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}} + 4 \, {\left (2 \, a b^{2} \cosh \left (x\right )^{7} - 3 \, {\left (a b^{2} - b^{3}\right )} \cosh \left (x\right )^{5} + {\left (a^{3} + 4 \, a^{2} b + 9 \, a b^{2}\right )} \cosh \left (x\right )^{3} + {\left (a^{3} + 3 \, a^{2} b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{\cosh \left (x\right )^{6} + 6 \, \cosh \left (x\right )^{5} \sinh \left (x\right ) + 15 \, \cosh \left (x\right )^{4} \sinh \left (x\right )^{2} + 20 \, \cosh \left (x\right )^{3} \sinh \left (x\right )^{3} + 15 \, \cosh \left (x\right )^{2} \sinh \left (x\right )^{4} + 6 \, \cosh \left (x\right ) \sinh \left (x\right )^{5} + \sinh \left (x\right )^{6}}\right ) + \sqrt {a} \log \left (-\frac {a \cosh \left (x\right )^{4} + 4 \, a \cosh \left (x\right ) \sinh \left (x\right )^{3} + a \sinh \left (x\right )^{4} + 2 \, {\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, a \cosh \left (x\right )^{2} + a + b\right )} \sinh \left (x\right )^{2} + \sqrt {2} {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} + 1\right )} \sqrt {a} \sqrt {\frac {a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + a + 2 \, b}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}} + 4 \, {\left (a \cosh \left (x\right )^{3} + {\left (a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + a}{\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}\right )}{4 \, a}, -\frac {\sqrt {-a} \arctan \left (\frac {\sqrt {2} {\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + a\right )} \sqrt {-a} \sqrt {\frac {a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + a + 2 \, b}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}}}{a b \cosh \left (x\right )^{4} + 4 \, a b \cosh \left (x\right ) \sinh \left (x\right )^{3} + a b \sinh \left (x\right )^{4} - {\left (a^{2} + 3 \, a b\right )} \cosh \left (x\right )^{2} + {\left (6 \, a b \cosh \left (x\right )^{2} - a^{2} - 3 \, a b\right )} \sinh \left (x\right )^{2} - a^{2} + 2 \, {\left (2 \, a b \cosh \left (x\right )^{3} - {\left (a^{2} + 3 \, a b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}\right ) + \sqrt {-a} \arctan \left (\frac {\sqrt {2} \sqrt {-a} \sqrt {\frac {a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + a + 2 \, b}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}}}{a \cosh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) \sinh \left (x\right ) + a \sinh \left (x\right )^{2} + a}\right )}{2 \, a}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {a + b \operatorname {sech}^{2}{\left (x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {1}{\sqrt {a+\frac {b}{{\mathrm {cosh}\left (x\right )}^2}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________